<?php

/**
 * @Author: king
 * @Date:   2019-05-04 17:37:39
 * @Last Modified by:   king
 * @Last Modified time: 2019-05-05 16:17:44
 */
namespace App\Models\Api;
use App\Exceptions\ApiException;
use App\Models\Api\Base;
use Cache;
/**
 * 课程浏览统计模型
 * Class LanmeiCourseSectionInfo
 * @package app\common\model
 */
class LanmeiCourseSectionInfo extends Base
{
   protected $table ='course_section_info';


    /**
     * 添加课程浏览记录
     * @param array $map
     * @return bool
     */
   public function save_section_info($map=[])
   {
       $uid= $map['uid'];
       $cid= $map['cid'];

       $arr =[
           'cid'=>$cid,
           'uid'=>$uid
       ];

       try{
           $this->insert($arr);
       }catch (\Exception $e)
       {
          \Log::info('统计用户浏览次数失败'.$e->getMessage());
       }

       return true;
   }

}
